home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9417 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: news.primenet.com!wisniew
  2. From: Joseph Wisniewski <wisniew@primenet.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Converting to "FULL" ASCII
  5. Date: 11 Mar 1996 04:18:01 -0700
  6. Organization: Primenet (602)395-1010
  7. Sender: root@primenet.com
  8. Message-ID: <4i1259$n8g@nnrp1.news.primenet.com>
  9. References: <4i0prp$tn6@lantana.singnet.com.sg>
  10. X-Posted-By: wisniew@usr2.primenet.com
  11.  
  12. Don't know the specific answer to your question, however it probably has
  13. something to do with signed and unsigned chars. A side note when dealing
  14. with 8-bit characters however, "if" tests may not work as one would think.
  15. For example, if you haved loaded an 8-bit character into a "char", the
  16. following does NOT work as intended:
  17.  
  18. char Test_Char
  19.  
  20. if (Test_Char == 0x80)
  21.  ...
  22.  
  23. with Test_Char having the value x80, this test fails because the x80 sign
  24. extends out so that you are testing
  25.     FF80 with 0080.
  26. Solution, typecast the literal as a char or maybe declare Test_Char as
  27. an unsigned char.
  28.  
  29. Joe
  30.  
  31. Charles Lai <se7212079@ntuvax.ntu.ac.sg> wrote:
  32. : Hi... Does anyone know how to convert an integer 0-255 to its extended
  33. : ASCII representation?
  34.  
  35. : toascii only convert up to 127....
  36.  
  37. : Thanks & Regards
  38. : ---
  39. : Charles Lai 
  40. : Who? What? When? Where? Why?
  41.  
  42.  
  43. --
  44. Joe Wisniewski    
  45.   Commercial Software Solutions, Ltd. -- Embedded/RT SW Consulting
  46.   Co-Author: Program Smarter, Not Harder - Get Mission Critical Projects
  47.     Right the First Time ISBN 0-07-021232-5
  48.  
  49.   wisniew@primenet.com   --- The "Baltimore Browns"?     Pazhaloosta!
  50.   Ada95 --> She'll take you to places you never thought possible!
  51.   
  52.